/*
 * This file is part of GuitarMaster.
 * 
 * GuitarMaster is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * GuitarMaster is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.paris5.master2.guitarmaster.service;

import com.paris5.master2.guitarmaster.bean.EcomScore;
import com.paris5.master2.guitarmaster.bean.EcomStore;
import com.paris5.master2.guitarmaster.bean.EcomUser;
import com.paris5.master2.guitarmaster.exception.EcomException;
import com.paris5.master2.guitarmaster.exception.EcomQueryException;
import com.paris5.master2.guitarmaster.exception.EcomValidationException;
import javax.ejb.Remote;

/*
 * $Id: ServiceCustomerRemote.java 26 2013-04-05 04:09:09Z nedjahi.mourad@gmail.com $
 * 
 * $HeadURL: http://com-paris5-master2-guitarmaster-distrib.googlecode.com/svn/trunk/com.paris5.master2.guitarmaster.distrib/src/com/paris5/master2/guitarmaster/service/ServiceCustomerRemote.java $
 * $Revision: 26 $
 * $Date: 2013-04-05 04:09:09 +0000 (Fri, 05 Apr 2013) $
 * $Author: nedjahi.mourad@gmail.com $
 */

/**
 * Customer interface, list alla user actions
 *
 * @author Leticia Mahamed, Alice Khammy, mourad nedjahi, Saliou Mamadou Barry
 * @version %I%, %G%
 */
@Remote
public interface ServiceCustomerRemote {
    
    /**
     * Authentification method
     * @param login String
     * @param pwd String
     * @return EcomUser
     * @throws EcomTransactionException 
     * @throws EcomValidationException
     */
    public abstract EcomUser authentificate(String login, String pwd) throws EcomValidationException, EcomQueryException;
    
    /**
     * Admin authentification method
     * @param login String
     * @param pwd String
     * @return EcomUser
     * @throws EcomTransactionException 
     * @throws EcomValidationException
     */
    public EcomUser adminAuthentificate(String login, String pwd) throws EcomValidationException, EcomQueryException;

    /**
     * Subscribe method
     * @param bean EcomUser
     * @throws EcomTransactionException
     * @throws EcomValidationException 
     */
    public abstract void subscribe(EcomUser bean) throws EcomValidationException, EcomQueryException, EcomException;
    
    /**
     * 
     * @param bean
     * @throws EcomValidationException
     * @throws EcomException
     * @throws EcomQueryException 
     */
    public void unsubscribe(EcomUser bean) throws EcomValidationException, EcomException, EcomQueryException;
    
    /**
     * get user by id
     * @param id String
     * @return EcomUser
     * @throws EcomTransactionException 
     */
    public abstract EcomUser getUser(int id) throws EcomQueryException, EcomException;
    
   /**
     * modify user profile
     * @param id String
     * @return EcomUser
     * @throws EcomTransactionException 
     */
    public abstract void setUser(EcomUser usr) throws EcomQueryException, EcomValidationException;
    
    /**
     * set an amount to a user
     * @param user id int
     * @param amount float
     * @throws EcomTransactionException
     * @throws EcomValidationException
     */
    public abstract void setAmount(int id, float amount) throws EcomValidationException, EcomException;
    
    /**
     * increase or decrease user score depending on the second parameter
     * @param id_user String
     * @param increase Bolean increase/decrease
     * @throws EcomTransactionException
     * @throws EcomValidationException
     */
    public abstract EcomScore setUserScore(int id_user, boolean increase) throws EcomValidationException;
    
    public void withdrawUserBalance(Integer id_user, Float amount)throws EcomValidationException;
}
